package com.example.dtcloudalibabaconsumer.controller;

import com.example.dtcloudalibabaconsumer.DtCloudalibabaConsumerApplication;
import com.example.dtcloudalibabaconsumer.Service.OpenFeignConsumerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: 辛之所想
 * @create: 2025-11-13 21:49
 * @description:
 **/
@RestController
@RequestMapping("/openFeignConsumerController")
public class OpenFeignConsumerController {
    private static final Logger LOG = LoggerFactory.getLogger(OpenFeignConsumerController.class);
    @Resource
    private OpenFeignConsumerService openFeignConsumerService;
    /**
     * @Author 辛之所想
     * @Date  2025/11/14
     * @Param
     * @Description openFeign远程调用测试
     **/

    @GetMapping("/openFeignConsumer")
    public String openFeignConsumer(){
        LOG.info("测试openFeignConsumer");
        String resultStr = openFeignConsumerService.openFeignProducer();
        LOG.info("测试openFeignConsumer结果:{}",resultStr);
        return resultStr;
    }

    /**
     * @Author 辛之所想
     * @Date  2025/11/14
     * @Param
     * @Description nacos配置中心测试
     **/
    @GetMapping("/nacosConfig")
    public String nacosConfig(){
        LOG.info("测试nacosConfig");
        String resultStr = openFeignConsumerService.nacosConfig();
        LOG.info("测试nacosConfig:{}",resultStr);
        return resultStr;
    }
}
